
#include "stdafx.h"


int main(int argc, char** argv) 
{

	//tempmap < string,double> test(0,-999999,"day",1);
	//test.set_read_from_file("./weather/", "Fles92_A",".vwi","day",1, 1.0);
	//test.print_in_file_simple_style_without_mydate("./weather/", "Test1",".tdi");
	//test.print_in_file_simple_style_with_mydate("./weather/", "Test2",".tdi");
	//test.print_in_file_start_end_style_with_mydate("./weather/", "Test3",".tdi");
	//test.print_in_file_start_end_style_without_mydate("./weather/", "Test4",".tdi");

	//tempmap <string,double> monthly(0,-999999,"day",365);
	//vector<string> keys=test.get_valkeys();
	//monthly.set_aggregate_by_linear_interp_from_tempmap(test,"mean",2.0,0,99.9,keys);
	//monthly.print_in_file_start_end_style_without_mydate("./weather/", "Fles92_Atest",".tdi");
	//bimonthly.set_an_empty_tempmap(test.get_start(),test.get_end(),2.3,keys);

	//Teilmodelle parametrisieren

 //   RothC::read_RothC_Par_Maps(); //RothC
	//croprotentry::read_Rotation_Reader_Par_Maps(); // sub for reading the rotation
	//Rotation_Reader_Fert::read_Parameter_Maps();


	////1. constant values einlesen#####################################################
		list2d sitelist2D ("./props/","siteconst.txt");
		list2d *croprotlist2D=new list2d ("./props/","croprot.txt");
		list2d *fertrotlist2D=new list2d ("./props/","fertrot.txt");
	
		int sitenr=sitelist2D.nrows;
		int row;
		vector <plot> plotlist;
		for(row=0;row<sitenr;row++)
		{
			plot nullplot(sitelist2D,row,"sites");
			plotlist.push_back(nullplot);	   
			//_mkdir(plotlist[row].get_root().c_str());
			mkdir(plotlist[row].get_root().c_str(),0777);
			plotlist[row].set_inputs(croprotlist2D,fertrotlist2D);	
			plotlist[row].set_model_environment();
			plotlist[row].run();
		}



 //       IN_Rotation_Reader_Fert in_fert;
 //       in_fert.fertlist=*fertrot;
 //       Rotation_Reader_Fert::read_Parameter_Maps();
 //       Rotation_Reader_Fert::write_N_C_into_fertlist(in_fert);
 //       in_fert.fertlist.file="./props/fertlistCN.txt";
 //       in_fert.fertlist.write();
	//	plot nullplot;
	//	unsigned int row;
	//	vector<plot> plotlist;
	//	Hyd_hydropropsKA4 KA4;
	return 0;
}

